﻿using System;
using System.Collections.Generic;
using System.Drawing.Drawing2D;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.Script.Serialization;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using Channelvn.Cached;
using Core.Library;
using DataObject.Members;
using DataObject.Ref;
using DataObject.Upload;
using DataObject.Vote;
using SD = System.Drawing;
namespace Event
{

    public partial class Test : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //var xForwardedFor = HttpContext.Current.Request.ServerVariables["X-Forwarded-For"] != null ? HttpContext.Current.Request.ServerVariables["X-Forwarded-For"].Trim() : String.Empty;
            //var httpXForwardedFor = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"] != null ? HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"].Trim() : String.Empty;
            //var remoteAddr = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"] != null ? HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"].Trim() : String.Empty;
            //for (int i = 0; i < 1000; i++)
            //{
            //    var time = DateTime.Now;
            //    var o = new VoteLogObject
            //    {
            //        VoteLog_FromID = 11,
            //        VoteLog_FromEmail = "gui@gmail.com",
            //        VoteLog_FromName = "gui",
            //        VoteLog_ToID = 11,
            //        VoteLog_ToEmail = "nhan@gmail.com",
            //        VoteLog_ToName = "nhan",
            //        VoteLog_Time = time,
            //        VoteLog_XForwardedFor = xForwardedFor,
            //        VoteLog_HttpForwardedFor = httpXForwardedFor,
            //        VoteLog_RemoteAddr = remoteAddr,
            //        VoteLog_Round = RefCache.Ref_GetCurrentRound()
            //    };
            //    VoteController.Vote_AddVoteLogToCache(o);

            //    // gui sang redis 
            //    JavaScriptSerializer js = new JavaScriptSerializer();
            //    var json = js.Serialize(o);
            //    var rd = new Redis.VoteCache();
            //    rd.Enqueue(json);
            //}

        }
    }
}